package com.whl.sm.sysEnum;

public interface CommonEnum {

    /**
     * 审核操作
     */
    public enum RepairStatus {
        //正常状态
        SUBMIT(1, "提交报修"), DISTRIBUTION(2, "报修派单"), REPAIRING(3, "报修进行中"), COMPLETE(4, "维修完成"),APPRAISE(5, "服务评价"),
        //异常状态
        REFUSE(-1, "报修驳回"),WITHDRAW(-2, "报修撤回");
        private final Integer step;
        private final String value;

        RepairStatus(Integer step, String value) {
            this.step = step;
            this.value = value;
        }

        public static String getValueByStep(Integer step) {
            if (step == null) {
                return null;
            }
            for (CommonEnum.RepairStatus repairStatus : CommonEnum.RepairStatus.values()) {
                if (repairStatus.getStep().equals(step)) {
                    return repairStatus.getValue();
                }
            }
            return null;
        }

        public Integer getStep() {
            return step;
        }

        public String getValue() {
            return value;
        }
    }

    public enum  ApprovalStatus {
        //正常状态
        SUBMIT(1, "提交"), DISTRIBUTION(2, "审核中"), PASS(3, "认证通过"),
        //异常状态
        REFUSE(-1, "驳回"),WITHDRAW(-2, "撤回");
        private final Integer step;
        private final String value;

        ApprovalStatus(Integer step, String value) {
            this.step = step;
            this.value = value;
        }

        public static String getValueByStep(Integer step) {
            if (step == null) {
                return null;
            }
            for (CommonEnum.ApprovalStatus approvalStatus : CommonEnum.ApprovalStatus.values()) {
                if (approvalStatus.getStep().equals(step)) {
                    return approvalStatus.getValue();
                }
            }
            return null;
        }

        public Integer getStep() {
            return step;
        }

        public String getValue() {
            return value;
        }

    }


}
